library(rstan)

options(mc.cores=parallel::detectCores())
rstan_options(auto_write=TRUE)

model_code <- "
data {
  int<lower=0> N;
  vector[N] y;
}
parameters {
  real mu;
}
model {
  y ~ normal(mu, 1);
}

"

model_data <- list(N=5, y=c(-1.2, 0.3, 0.8, -0.5, 1.1))

fit <- stan(model_code =  model_code, data=model_data)
print(fit)

version


example(stan_model, package='rstan', run.dontrun=TRUE)


